{template header}
<script src="http://res.websdk.rongcloud.cn/RongIMClient-0.9.9.min.js"></script>
<script src="http://res.websdk.rongcloud.cn/RongIMClient.voice-0.9.1.min.js"></script>
<script type="text/javascript">
$(function(){

	//获取token
	// $.ajax({
	// 	type:"get",
	// 	url:"",
	// 	dataType:"json"
	// }).done(function(data){
	// 	data.im_token = "g90dnY6X1u0lptrnwAHGIJILLVV1R1BU8cNEJUafULQA9H07DZS9F2VnaxaMXFFyyJVUsgaFlXrmwv+x4EfMdA==";
	// 	if(data.im_token == 0){

	// 		RongIMClient.connect(data.im_token, {
 //                onSuccess: function (x) {
 //                    console.log("connected，userid＝" + x);

 //                    //链接成功之后同步会话列表
 //                    RongIMClient.getInstance().syncConversationList({
 //                        onSuccess: function () {
 //                            //同步会话列表
 //                            setTimeout(function () {
 //                                list = RongIMClient.getInstance().getConversationList();
 //                                $.each(list,function(key,item){
 //                                    switch(item.getConversationType()){
 //                                        case RongIMClient.ConversationType.CHATROOM:
 //                                            item.setConversationTitle("聊天室");
 //                                            break;
 //                                        case RongIMClient.ConversationType.CUSTOMER_SERVICE:
 //                                            item.setConversationTitle("客服");
 //                                            break;
 //                                        case RongIMClient.ConversationType.DISCUSSION:
 //                                            item.setConversationTitle("讨论组");
 //                                            break;
 //                                        case RongIMClient.ConversationType.GROUP:
                                            
 //                                            break;
 //                                        case RongIMClient.ConversationType.PRIVATE:

 //                                            break;
 //                                    }

 //                                    $("#conversationlist").append($("<li />")
 //                                                                .append("会话标题:" + item.getConversationTitle() + ";<br />")
 //                                                                .append("会话类型值:" + item.getConversationType().valueOf() + ";<br />")
 //                                                                .append("目标ID:" + item.getTargetId() + ";<br />")
 //                                                                .append("未读消息数:" + item.getUnreadMessageCount() + ";<br />")
 //                                                                .append("消息的最后时间戳:" + item.getLatestTime()) );
 //                                });
                                
                                
 //                            }, 1000);
 //                        }, onError: function () {
 //                        }
 //                    });
 //                },
 //                onError: function (c) {
 //                    var info = '';
 //                    switch (c) {
 //                        case RongIMClient.callback.ErrorCode.TIMEOUT:
 //                            info = '超时';
 //                            break;
 //                        case RongIMClient.callback.ErrorCode.UNKNOWN_ERROR:
 //                            info = '未知错误';
 //                            break;
 //                        case RongIMClient.ConnectErrorStatus.UNACCEPTABLE_PROTOCOL_VERSION:
 //                            info = '不可接受的协议版本';
 //                            break;
 //                        case RongIMClient.ConnectErrorStatus.IDENTIFIER_REJECTED:
 //                            info = 'appkey不正确';
 //                            break;
 //                        case RongIMClient.ConnectErrorStatus.SERVER_UNAVAILABLE:
 //                            info = '服务器不可用';
 //                            break;
 //                        case RongIMClient.ConnectErrorStatus.TOKEN_INCORRECT:
 //                            info = 'token无效';
 //                            break;
 //                        case RongIMClient.ConnectErrorStatus.NOT_AUTHORIZED:
 //                            info = '未认证';
 //                            break;
 //                        case RongIMClient.ConnectErrorStatus.REDIRECT:
 //                            info = '重新获取导航';
 //                            break;
 //                        case RongIMClient.ConnectErrorStatus.PACKAGE_ERROR:
 //                            info = '包名错误';
 //                            break;
 //                        case RongIMClient.ConnectErrorStatus.APP_BLOCK_OR_DELETE:
 //                            info = '应用已被封禁或已被删除';
 //                            break;
 //                        case RongIMClient.ConnectErrorStatus.BLOCK:
 //                            info = '用户被封禁';
 //                            break;
 //                        case RongIMClient.ConnectErrorStatus.TOKEN_EXPIRE:
 //                            info = 'token已过期';
 //                            break;
 //                        case RongIMClient.ConnectErrorStatus.DEVICE_ERROR:
 //                            info = '设备号错误';
 //                            break;
 //                    }
 //                    console.log("失败:" + info);
 //                }
 //            });
	// 	}else{
	// 		console.log("获取token失败");
	// 	}

	// }).fail(function(){

	// });

	//RongIMClient.init("p5tvi9dst2jj4");
	
	
	// RongIMClient.voice.onprogress ＝ function(){
 //          console.log("正在执行");
 //    };


 // 	var isInit = RongIMClient.voice.init();
	// console.log(isInit);
	// RongIMClient.voice.play('IyFBTVIKPJEXFr5meeHgAeev8AAAAIAAAAAAAAAAAAAAAAAAAAA8SHcklmZ54eAB57rwAAAAwAAAAAAAAAAAAAAAA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DwEBboWDukXMO\/c6vC1oNb1WS2FCrYF4IjRsWgWUOEAPAitoTZgprfFsNFK43voBBo6+WAFkXa0KJVAOk7zYDA8BAmgHmIS9QHtLBpzlbotE3cI4HI\/V2uVn1URJnqRwDwEIZ82YMIW0G8+qoT4YdD4C3cquJvTicCA3d0UNrawPAQOND5ktnHh6Q1aLKY7Bg6YhpnhqYmfwKDy2sC3qnA8Ar+ALhfxhaHwqUoGApntC0+E\/ytXeaRoqNofflTm4DwIQDQ+TCmIgcYKWv3wC8fA644E40BuktrYdvl6kIkAPAg0bBr5w1xh4YNs9jy6KCjXuL7n8QLrlvTCFDIL7aA8BrgzR3PRE2GmqmdPySJlAtC\/r+CbjbFBVWYW2gSzQDzYUX8qrLAEoNYqm5IQ2zJt5UlDqxPakINH\/YG+e3PAPAQ1mkOqwRqBtU8bgRR1S1nwLDpGxQNyHwr3MvFP1cA84Cl5f8f6RyHgKthROk8LwlAEvVStFlH\/h2a6+9e\/oDwIQ5nv+D8WYU5aC\/cvFANU2cJAEMqz82qp2bBQBXGA','2');
});

</script>
<div class="bs-docs-example" style="clear:both;">

    <form class="form-horizontal" method="post">
        
        <div class="control-group dib">
            <label class="control-label" for="inputShortDesc">发送方id:</label>
            <div class="controls">
                <input name="fromname" type="text" placeholder="发送方id" value="{$source_id}" style="width:260px;">    
            </div>
        </div>
        <div class="control-group dib">
            <label class="control-label" for="inputShortDesc">接收方id:</label>
            <div class="controls">
                <input name="toname" type="text" placeholder="接收方id" value="{$target_id}" style="width:260px;">    
            </div>
        </div>
        <div class="control-group dib">
            <div class="controls">
                <input type="hidden" value="search" name="search">
                <button type="submit" class="btn">查询</button>
            </div>
        </div>
    </form>


    <table class="table table-striped">
        <thead>
            <tr>
                <th width="60">ID</th>
                <th width="100">发送人</th>
                <th width="100">接收人</th>
                <th width="100">操作</th>
                <!-- <th width="100">消息类型</th>
                <th width="100">消息内容</th>
                <th width="100">消息时间</th> -->
            </tr>
        </thead>
        <tbody>
            {if !$data}  
                <tr>
                    <td>暂无记录</td>
                    <td></td>     
                    <td></td>              
                </tr>
            {else}
            {loop $data $k $item}
            <tr>
                <td>{$item['id']}</td>
                <td><img width="30" height="30" src="{$item['formUserHeader']}">&nbsp;&nbsp;&nbsp;{$item['formUserName']}({$item['fromUserId']})</td>
                <td><img width="30" height="30" src="{$item['toUserHeader']}">&nbsp;&nbsp;&nbsp;{$item['toUserName']}({$item['toUserId']})</td>	

                <td><a href="?c=admin&a=MessagePrivateContent&toUserId={$item['toUserId']}&fromUserId={$item['fromUserId']}">查看</a></td>
                <!-- <td>{$item['typeName']}</td>
                <td>{if $item['type'] == 'RC:ImgMsg'}<img width="30" height="30"  src="{$item['content']}"><a href="{$item['content']}" target="_blank">查看</a>{else}{$item['content']}{/if}</td>
                <td>{eval echo date('Y-m-d H:i:s', $item['timestamp'])}</td> -->
            </tr>
            {/loop}
            {/if}
        </tbody>
    </table>
</div>
<div class="pagination">
    <ul>
        {$pageStr}
    </ul>
</div>
{template footer}
